As the motor control device that controls the motor for driving the industrial machine, there is known a motor control device that controls a motor such that a rotating position (a rotating angle) and speed of the motor detected by a detector such as a rotary encoder connected to a rotating shaft of the motor follow up target positions.
It is known that, in the detector such as the rotary encoder, a detector error occurs in a detection signal because of an assembly error, a shape error, or the like of the detector. For example, in a magnetic detector, a section to be detected imparted with a magnetic characteristic that periodically changes in association with the rotation of the rotating shaft of the motor is used. The magnetic detector detects magnetism with a magnetic sensor arranged in the vicinity of the motor to detect a rotating position of the motor. In the magnetic detector, when there is an error in a magnetization distribution or an attachment error of the magnetic sensor, a periodical detection error depending on the rotating position occurs.
The detection error that periodically occurs according to the rotating position included in the detection signal of the detector in this way adversely affects driving performance of a machine. Therefore, there have been proposed various systems for enabling highly accurate driving by suppressing such a detection error on the control device side (see, for example, Patent Literatures 1 and 2).
Patent Literature 1 discloses a technology for preparing a high-precision detector besides a detector used for driving control, comparing a position detected by the detector used for the driving control and a position detected by the highly-precision detector to calculate a detection error and store the detection error in a control device and correcting the stored detection error with respect to a rotation command position to the motor.
Further, Patent Literature 1 discloses, as a system in which the high-precision detector is not used, a technology for calculating a detection error based on a detection signal in a state in which a motor is rotated at sufficient speed that a speed loop characteristic for controlling the motor does not follow up and a technology for calculating a detection error based on a detection signal in a state in which a motor is rotated with a speed loop opened, i.e., without using a signal of a detector.
Patent Literature 2 discloses, as a system for performing correction to offset a periodically-occurring detection error using a correction amount of the same period calculated by a trigonometric function operation, a technology for searching for optimum values of an amplitude (a gain) and a phase of a correction amount to minimize the amplitude of the detection error.